<!DOCTYPE HTML>
<html lang="zh-CN">




<head>
    <meta charset="utf-8">
    <meta name="keywords" content="&#39;Database&#39;, 深度学习 故障诊断 Java">
    <meta name="description" content="河海大学 | 计算机与信息学院 | 信号与信息处理">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>&#39;Database&#39; | 世庆的博客</title>
    <link rel="icon" type="image/png" href="/shiqing/favicon.png">

    <link rel="stylesheet" type="text/css" href="/shiqing/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/css/my.css">

    <script src="/shiqing/libs/jquery/jquery.min.js"></script>

    <script src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8"></script>
<meta name="generator" content="Hexo 6.3.0"></head>




    <body>
        <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/shiqing/" class="waves-effect waves-light">
                    
                    <img src="/shiqing/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">世庆的博客</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/shiqing/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">世庆的博客</div>
        <div class="logo-desc">
            
            河海大学 | 计算机与信息学院 | 信号与信息处理
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/sqtian-hhu/" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/sqtian-hhu/" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

        



<div class="bg-cover pd-header post-cover" style="background-image: url('/shiqing/medias/featureimages/3.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">&#39;Database&#39;</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/shiqing/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/shiqing/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/">
                                <span class="chip bg-color">数据库</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/shiqing/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/" class="post-category">
                                数据库
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-02-26
                </div>
                

                

                

                

                
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/shiqing/libs/prism/prism.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2 id="数据库设计"><a href="#数据库设计" class="headerlink" title="数据库设计"></a>数据库设计</h2><p>三范式：列不可拆分<br>       唯一标识<br>       引用主键</p>
<span id="more"></span>
<p>E-R模型				<br>关系及存储：<br>        1对1：一个对象A对应着一个对象B，一个对象B对应着一个对象A，<br>        关系可以存入A也可以存入B<br>        1对多：一个对象对应着n个对象B，一个对象B对应着一个对象A，<br>        关系存入B对象中<br>        多对多： 一个对象A对应着n个对象B，一个对象B也对应着n个对象A，<br>        关系存入新建的一个关系表中</p>
<p>– 查询<br>– select * from hero<br>– 创建表<br>CREATE TABLE students3 (<br>id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,<br>NAME VARCHAR (10), age INT UNSIGNED) ；<br>SELECT </p>
<p>  *<br>FROM<br>  students3 ；</p>
<p> – 删除表</p>
<p> DROP TABLE IF EXISTS students2；<br> DROP TABLE students；</p>
<p> – 插入</p>
<p>INSERT INTO students3 VALUES(0,’cc’,18)<br>主键默认写0，</p>
<p>插入多条<br>INSERT INTO students3 VALUES(0,’cc’,18),(0，’tt’，18),(0,’yy’,18);</p>
<p>给指定字段插入<br>INSERT INTO students3(id,name,age) VALUES(0,’cc’,18),(0，’tt’，18),(0,’yy’,18);</p>
<p>– 修改</p>
<p>updata students3 set name &#x3D; ‘ll’,age &#x3D; 18 where id &#x3D; 2;</p>
<p>– 删除</p>
<p>delete from students3 where id &#x3D; 3;</p>
<p>– 逻辑删除（还可以恢复）</p>
<ol>
<li>设计表，给表添加一个字段isdelete，1代表删除，0代表没有删除</li>
<li>给所有数据的isdelete都改为0</li>
<li>要删除某一条数据时，更新isdelete为1</li>
<li>查询数据时，只查询isdelete为0的数据</li>
</ol>
<p>alter table student add isdelete int</p>
<p>updata student set isdelete where id &#x3D;1;</p>
<p>– 显示没有标记删除的数据<br>select * from student where isdelete&#x3D;0;</p>
<p>– 查询 *代表所有列<br>select name,sex,hometown from students; </p>
<p>– 查询时显示字段别名 （as 可以省略）<br>select name as 姓名,sex as 性别,hometown 家乡from students; </p>
<p>– 给表起别名（查询多个表时使用）<br>select s.name,s.sex,s.hometown from students as s;</p>
<p>– 去重<br>查询学生性别有几种<br>select distinct sex from students;</p>
<p>select distinct sex,class from students;</p>
<p>– 查询小乔的年龄</p>
<p>select age from students where name &#x3D; ‘小乔’；</p>
<p>where 后面过滤行，select 后面过滤列</p>
<p>– 查询20岁以下的学生</p>
<p>select * from students where age &lt; 20;</p>
<p>– 查询家乡不在北京</p>
<p>select * from students where hometown !&#x3D; ‘北京’；</p>
<p>–练习</p>
<ol>
<li><p>查询学号007的学生的身份证号码<br>select card from students where studentNo &#x3D; ‘007’;</p>
</li>
<li><p>查询1班以外的学生信息<br>select * from students where calss !&#x3D; ‘1班’;</p>
</li>
</ol>
<p>3。 查询年龄大于20的学生的姓名和性别<br>select name,sex from students where age &gt; 20;</p>
<p>–逻辑运算<br>and or not </p>
<ol>
<li><p>查询年龄小于20的女同学<br>select * from students where age &lt; 20 and sex &#x3D; ‘女’;</p>
</li>
<li><p>查询女学生或一班学生<br>select * from students where sex &#x3D; ‘女’ or class &#x3D; ‘1班’;</p>
</li>
</ol>
<p>– 查询家乡不在北京</p>
<p>select * from students where not hometown &#x3D; ‘北京’；</p>
<h2 id="各种查询"><a href="#各种查询" class="headerlink" title="各种查询"></a>各种查询</h2><p>– 模糊查询<br>like<br>% 表示任意多个字符<br>_ 表示一个字符</p>
<p>查询姓田的学生<br>select * from students where name like ‘田%’;</p>
<p>查询姓田且名字是一个字<br>select * from students where name like ‘田_’;</p>
<p>查询名字是呈呈的学生<br>select * from students where name like ‘%呈呈’;</p>
<p>查询名字含庆的学生<br>select * from students where name like ‘%庆%’;</p>
<p>查询姓名为两个字的学生<br>select * from students where name like ‘__’;</p>
<p>– 范围查询<br>查询家乡是北京上海深圳的学生<br>select * from students where hometown in (‘北京’,’上海’,’深圳’);</p>
<p>查询年龄在18到20之间的学生<br>select * from students where age between 18 and 20;</p>
<p>– 空判断<br>is null</p>
<p>select * from students where card is null;<br>与空字符串不同<br>select * from students where card &#x3D; ‘ ‘;</p>
<p>– 排序<br>asc 升序(可省略) desc 降序<br>select * from 表名 order by 列1 asc|desc,列2 asc|desc;</p>
<p>select * from students order by age asc;</p>
<p>年龄相同时再按学号从小到大排<br>select * from students order by age, studentNo；</p>
<p>中文排序需要把utf转成国标<br>select * from students order by convert(name using gbk);</p>
<p>– 聚合函数</p>
<p>– 查询学生总数<br>select count(<em>) from students;<br>select count(</em>) from students where class &#x3D; ‘1班’;</p>
<p>– 查询女生最大年龄<br>select max(age) from students where sex &#x3D; ‘女’;</p>
<p>– 一班最小年龄<br>select min(age) from students where class &#x3D; ‘一班’;</p>
<p>– sum() 求此列的和<br>– 查询北京学生年龄总和<br>select sum(age) from students where hometown &#x3D; ‘北京’;</p>
<p>– 查询女生平均年龄<br>select avg(age) from students where sex &#x3D; ‘女’;</p>
<p>– 取别名<br>select max(age) 最大年龄, min(age) 最小年龄, avg(age) 平均年龄 from students </p>
<p>– 分组</p>
<p>查询各种性别的人数<br>select sex, count(*) from students group by sex;</p>
<p>查询各种年龄的人数<br>select age, count(*) from students group by age;</p>
<p>查询各个班级的最大年龄，最小年龄，平均年龄<br>select class,max(age),min(age),avg(age) from students group by class;</p>
<p>多字段分组<br>select class,sex,count(*) from students group by class,sex;</p>
<p>分组后再过滤<br>having 必须用在group by 后面<br>select sex, count(*) from students group by sex having sex &#x3D; ‘男’;</p>
<p>查询一班以外的其他班学生最大年龄。最小年龄，平均年龄<br>select class, max(age), min(age),avg(age)from students where class !&#x3D; ‘1班’ group by class;</p>
<p>select class, max(age), min(age),avg(age)from students group by class not having class &#x3D; ‘1班’;</p>
<p>– 分页， 获取部分行<br>查询前三行学生信息<br>0是起始位置，3是获取个数，从0 起始时0可以省略<br>select * from students limit 0,3; </p>
<p>每页显示三条，分页<br>先获取总数N，获取总页数N&#x2F;3<br>第L页<br>select count(<em>) from students limit 3</em>(L-1),3</p>
<p>– 连接查询<br>把两个表连起来显示</p>
<p>先连接起来再用where过滤，会产生临时表占内存<br>select * from students,scores where students.studentNo &#x3D; scores.studentNo;</p>
<p>select * from students as stu,scores as sc where stu.studentNo &#x3D; sc.studentNo;</p>
<p>– 内连接<br>连接时先判断，等于则连接(节约内存)，交集</p>
<p>select * from students inner join scores on students.studentNo &#x3D; scores.studentNo;</p>
<p>三个表连接<br>select * from students，courses, scores where students.studentNo &#x3D; scores.studentNo and scores.courseNo  &#x3D;courses.courseNo;</p>
<p>select * from students<br>inner join scores on students.studentNo &#x3D; scores.studentNo<br>inner join courses on scores.courseNo &#x3D; course.courseNo</p>
<p>查询西门吹雪的单杀成绩，要求显示姓名，课程号，成绩<br>select<br>students.name as 姓名, courses.courseNo as 课程号, scores.score as 成绩<br>from students<br>inner join scores on students.studentNo &#x3D; scores.studentNo<br>inner join courses on scores.courseNo &#x3D; courses.courseNo<br>where students.name &#x3D; ‘西门吹雪’ and courses.name &#x3D; ‘单杀’;</p>
<p>查询所有学生成绩，包括没有成绩的学生<br>left join 左表全显示出来<br>左连接 join 左边的表称为左表<br>select * from students<br>left join scores on students.studentNo &#x3D; scores.studentNo</p>
<p>select * from students<br>left join scores on students.studentNo &#x3D; scores.studentNo<br>left join courses on scores.courseNo &#x3D; course.courseNo</p>
<p>right join 右表全显示出来</p>
<p>自关联<br>存在上下级关系，如地址</p>
<p>编号，区域，上级编号用一个表存储<br>aid，atitle，pid</p>
<p>查询河南省所有城市</p>
<p>select * from areas,areas_copy where areas.aid &#x3D; areas_copy.pid and areas.atitle &#x3D; ‘河南省’;</p>
<p>实际上并不要copy<br>select * from areas as sheng,areas as shi where sheng.aid &#x3D; shi.pid and sheng.atitle &#x3D; ‘河南省’;</p>
<p>查询郑州市下所有区<br>select * from areas as sheng,areas as shi where sheng.aid &#x3D; shi.pid and sheng.atitle &#x3D; ‘郑州市’;</p>
<p>三级查询<br>查询 河南省下所有区县<br>select * from areas as sheng,areas as shi, areas as qu where sheng.aid &#x3D; shi.pid and shi.aid &#x3D; qu.pid and sheng.atitle &#x3D; ‘河南省’;</p>
<p>– 子查询<br>在一个select里嵌入另一个select</p>
<p>查询大于平均年龄的学生<br>select avg(age) from students;<br>select * from students where age &gt; 21.5833;</p>
<p>嵌入<br>select * from students where age &gt;(select avg(age) from students);</p>
<p>查询最小年龄的人<br>select * from students where age &#x3D;(select min(age) from students);</p>
<p>–<br>标量子查询，子查询返回的结果是一个值<br>查询王昭君的成绩<br>select studentNo from students where name &#x3D; ‘王昭君’;<br>select score from courses where studentNo &#x3D; ‘001’;</p>
<p>嵌入</p>
<p>select score from courses where studentNo &#x3D; (select studentNo from students where name &#x3D; ‘王昭君’);</p>
<p>查询西门吹雪的数据库成绩，要求返回成绩<br>select score from courses where studentNo &#x3D; (select studentNo from students where name &#x3D; ‘西门吹雪’)<br>and courseNo &#x3D; (select courseNo from courses where name &#x3D; ‘数据库’);</p>
<p>– 列级子查询<br>子查询返回的是一列多行</p>
<p>查询十八岁学生的成绩，要求显示成绩<br>select studentNo from students where age &#x3D; 18;<br>select score from scores in (‘002’,’006’)</p>
<p>嵌入<br>select score from scores in (select studentNo from students where age &#x3D; 18);</p>
<p>– 行级子查询<br>子查询返回一行多列</p>
<p>查询男生中年龄最大的学生信息<br>select * from students where sex &#x3D; ‘男’ and age &#x3D; 26;</p>
<p>select * from students where (sex,age) &#x3D; (‘男’,26);</p>
<p>select * from students where （sex,age) &#x3D; (select sex,age from students where sex &#x3D; ‘男’ order by age desc limit 1);</p>
<p>– 表级子查询</p>
<p>查询数据库和系统测试的课程成绩<br>先连接再筛选<br>select * from scores<br>inner join courses on scores.courseNo &#x3D; courses.courseNo<br>where course.name in (‘数据库’,’系统测试’);</p>
<p>先筛选再连接<br>把查询出来的结果当成数据源,一定要取别名</p>
<p>select * from scores<br>inner join (select * from courses where name in (‘数据库’,’系统测试’)) as c on scores.courseNo &#x3D; c.courseNo </p>
<p>any，some<br>&#x3D;any 相当于 in</p>
<blockquote>
<p>any 大于其中任意一个都行，即大于最小值<br>&lt;any 小于其中任意一个都行，即小于最大值<br>!&#x3D;any 没有意义</p>
</blockquote>
<p>all<br>!&#x3D;all 除去这些</p>
<blockquote>
<p>all 大于所有，即大于最大值<br>&lt;all 小于所有，即小于最小值<br>&#x3D;all 没有意义</p>
</blockquote>
<p>商品表练习<br>id name cate brand_name price is_show is_saleoff</p>
<ol>
<li><p>求所有产品的平均价格，保留两位小数<br>select round(avg(price),2) as avg_price from goods;</p>
</li>
<li><p>查询所有价格大于平均价格（保留两位小数）的商品，并且按价格降序排序<br>select * from goods where price &gt; (select round(avg(price),2) from goods) order by price desc;</p>
</li>
<li><p>查询价格大于等于超极本的商品，并且价格降序<br>select * from goods where price &gt;&#x3D; any(select price from goods where cate &#x3D; ‘超极本’) order by price desc;</p>
</li>
</ol>
<p>– 数据分表<br>分出一个类型表，把重复的数据单独存起来<br>create table good_cates(<br>id int unsigned primary key auto_increment,<br>cate_name varchar(10)<br>);</p>
<p>select distinct cate from goods;</p>
<p>把一个表查询出来的数据插入到另一个表<br>insert into good_cates(cate_name) select distinct cate from goods;</p>
<p>创建品牌表<br>create table goods_brands(<br>id int unsigned primary key auto_increment,<br>brand_name varchar(10)<br>) select distinct brand_name from goods;</p>
<p>update goods<br>inner join goods_cates on goods.cate &#x3D; goods_cates.cate_name<br>set goods.cate &#x3D; goods_cates.id</p>
<h2 id="内置函数"><a href="#内置函数" class="headerlink" title="内置函数"></a>内置函数</h2><p>字符串函数<br>拼接字符串concat（str1,str2…)</p>
<p>select concat(123,’abc’)</p>
<p>长度<br>select length()<br>中文长度是3</p>
<p>截取字符串<br>left(str,len) 从左边截，返回字符串str的左端len个字符<br>right(str,len) 返回字符串str的右端len个字符<br>substring(str,pos,len) 返回字符串str的位置pos起len个字符，pos从1开始，不是从0开始</p>
<p>select name, sex,concat(left(name,1),’某某’) from students;</p>
<p>去除空格<br>ltrim(str) 返回删除了左空格的字符串<br>rtrim(str) 返回删除了右空格的字符串</p>
<p>大小写<br>select upper()<br>select lower()</p>
<p>四舍五入<br>select round(1.6,1) 1表示小数点后几位</p>
<p>当前日期时间<br>now()</p>
<p>日期格式化 data_format(data,format)<br>参数format %Y %y %m 等等</p>
<p>– 流程控制<br>case语法<br>select<br>case 1<br>when 1 then ‘one’<br>when 2 then ‘two’<br>else ‘zero’</p>
<p>end as result;</p>
<p>select name,sex from students<br>case sex<br>when ‘男‘ then concat(left(name,1),’先生’)<br>when ‘女’ then concat(left(name,1),’女士’)<br>else concat(left(name,1),’公公’)</p>
<p>end as result;</p>
<p>– 自定义函数<br>delimiter $$<br>creat function 函数名称(参数列表) returns 返回类型<br>begin<br>sql语句;<br>end</p>
<p>$$<br>命令行运行时遇到分号会直接运行，delimiter将运行标志改成$$</p>
<p>– 存储过程<br>delimiter $$<br>creat procedure 过程名称()<br>begin<br>sql语句;<br>end</p>
<p>$$ </p>
<p>call 过程名称;</p>
<p>– 视图<br>create view v_stu as<br>select * from students<br>…..</p>
<p>调用时<br>select * from v_stu<br>直接调用view中查询的表</p>
<p>– 事务<br>开启事务<br>begin；<br>所有操作都成功<br>…..<br>commit;</p>
<p>begin；<br>如果有任意一步失败<br>rollback；</p>
<p>– 索引<br>优化查询速度，但降低了更新效率<br>创建<br>create index title_index on test_index(title(10));</p>
<p>建表时创建<br>create table create_index(<br>id int primary key,<br>name varchar(10) unique,<br>age int;<br>key(age)<br>);<br>只要是主键，建表时自动附带索引<br>带有unique的自动建索引<br>手动给字段加索引 key()</p>
<p>表已经存在时添加索引<br>create index 索引名称 on 表名(字段名称(长度))</p>
<p>– 外键<br>根据一个表约束另一个表，但会降低更新效率<br>alter table 从表名 add foreign key (从表字段) references 主表名(主表字段);</p>
<p>alter table stu add foreign key (class_id) references class(id);<br>用class的id约束stu的班级号</p>
<p>删除约束<br>alter table 从表名 drop foreign key 外键名称</p>
<p>– 修改密码</p>
<p>use mysql;<br>update user set password&#x3D;password(‘新密码’) where user &#x3D; ‘用户名’;</p>
<p>flush privileges;</p>
<p>– 忘记密码<br>MySQL\MySQL Sever\my.ini<br>找到mysqld<br>添加一行 skip-grant-tables<br>重启免密登录，修改密码后删除此行</p>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/shiqing/about" rel="external nofollow noreferrer">ShiQing</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://shiqing.gitee.io/shiqing/2020/02/26/java-ji-chu/database/">https://shiqing.gitee.io/shiqing/2020/02/26/java-ji-chu/database/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/shiqing/about" target="_blank">ShiQing</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/shiqing/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/">
                                    <span class="chip bg-color">数据库</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/shiqing/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/shiqing/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/shiqing/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/shiqing/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/shiqing/2020/03/11/java-ji-chu/javabasics/">
                    <div class="card-image">
                        
                        
                        <img src="/shiqing/medias/featureimages/15.jpg" class="responsive-img" alt="&#39;JavaBasics&#39;">
                        
                        <span class="card-title">&#39;JavaBasics&#39;</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            Java 基础&#x2F;&#x2F;方法定义
修饰符 返回值类型 方法名称(参数类型 参数名称, …){    方法体    return 返回值}
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2020-03-11
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/shiqing/categories/Java/" class="post-category">
                                    Java
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/shiqing/tags/Java%E5%9F%BA%E7%A1%80/">
                        <span class="chip bg-color">Java基础</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/shiqing/2020/02/07/myfirstblog/">
                    <div class="card-image">
                        
                        
                        <img src="/shiqing/medias/featureimages/18.jpg" class="responsive-img" alt="myfirstblog">
                        
                        <span class="card-title">myfirstblog</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            搭建hexo并部署到github
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-02-07
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/shiqing/categories/%E4%BB%A3%E7%A0%81%E7%AE%A1%E7%90%86/" class="post-category">
                                    代码管理
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/shiqing/tags/%E4%BB%A3%E7%A0%81%E7%AE%A1%E7%90%86/">
                        <span class="chip bg-color">代码管理</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/shiqing/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/shiqing/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/shiqing/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/shiqing/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/shiqing/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




        <footer class="page-footer bg-color">
    
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2019-2024</span>
            
            <span id="year">2019</span>
            <a href="/shiqing/about" target="_blank">ShiQing</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/blinkfox" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:2528393970@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>



    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2528393970" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 2528393970" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/shiqing/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


        <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/shiqing/search.xml', 'searchInput', 'searchResult');
});
</script>

        <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


        <script src="/shiqing/libs/materialize/materialize.min.js"></script>
        <script src="/shiqing/libs/masonry/masonry.pkgd.min.js"></script>
        <script src="/shiqing/libs/aos/aos.js"></script>
        <script src="/shiqing/libs/scrollprogress/scrollProgress.min.js"></script>
        <script src="/shiqing/libs/lightGallery/js/lightgallery-all.min.js"></script>
        <script src="/shiqing/js/matery.js"></script>

        <!-- Baidu Analytics -->

        <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

        
        <script src="/shiqing/libs/others/clicklove.js" async="async"></script>
        
        
        <script async src="/shiqing/libs/others/busuanzi.pure.mini.js"></script>
        

        <script type="text/javascript">
            var OriginTitile = document.title,
                st;
            document.addEventListener("visibilitychange", function () {
                document.hidden ? (document.title = "看不见我~看不见我~", clearTimeout(st)) : (document.title =
                    "(๑•̀ㅂ•́) ✧被发现了～", st = setTimeout(function () {
                        document.title = OriginTitile
                    }, 3e3))
            })
        </script>

        <!-- 背景樱花飘落特效 -->
        
            <script type="text/javascript">
                //只在桌面版网页启用特效
                var windowWidth = $(window).width();
                if (windowWidth > 768) {
                    document.write('<script type="text/javascript" src="/js/xuehuapiaoluo.js"><\/script>');
                }
            </script>
        

        

        


        
        

        

        

        
        <script src="/shiqing/libs/instantpage/instantpage.js" type="module"></script>
        

    </body>

</html>
